package com.huangjue.backend.service.impl;

import com.huangjue.backend.entity.Student;
import com.huangjue.backend.mapper.StudentMapper;
import com.huangjue.backend.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentMapper studentMapper;
    @Override
    public Student createStudent(Student student) {
        studentMapper.insert(student);
        return student;
    }

    @Override
    public Student getStudentByUserId(Integer userId) {
        return studentMapper.selectByUserId(userId);
    }

    @Override
    public boolean updateStudent(Student student) {
        return studentMapper.update(student) > 0;
    }
} 